package co.yixiang.modules.adopt.service;

import co.yixiang.common.service.BaseService;
import co.yixiang.modules.adopt.entity.domain.YxAdoptFeature;
import co.yixiang.modules.adopt.entity.dto.YxAdoptFeatureQueryCriteria;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface YxAdoptFeatureService extends BaseService<YxAdoptFeature> {

    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String, Object>
     */
    Map<String, Object> queryAll(YxAdoptFeatureQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<YxStoreCategoryDto>
     */
    List<YxAdoptFeature> queryAll(YxAdoptFeatureQueryCriteria criteria);

    /**
     * 导出数据
     * @param all 待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List<YxAdoptFeature> all, HttpServletResponse response) throws IOException;


    YxAdoptFeature saveVariety(YxAdoptFeature adoptFeature);

    void updateFeature(YxAdoptFeature resources);

    /**
     * 删除
     * @param id
     */
    void delete(Integer id);

    /**
     * 检查是否 存在 重复的品种名称
     * @param name
     * @param id
     * @return
     */
    boolean checkFeatureExist(String name, Integer id);

    List<YxAdoptFeature> selectListByCateId(Integer cateId);
}
